package seg.cd;


public class CDMaximum extends CornerDetector {

	public CDMaximum(int k, double[] rs) {
		super(k, rs);
	}

	public void filtrate() {
		setIndex(new int[] { findMaxRhoIndex() });
	}

	private int findMaxRhoIndex() {
		int index = getStart();
		double rhos[] = getRhos();
		for (int i = getStart() + 1; i < getEnd(); i++) {
			if (rhos[index] < rhos[i])
				index = i;
		}
		return index;
	}
}
